#! /usr/bin/env python3

# Rotab 0.1
# Written by Jonathan Burgess and 賢進学


import subprocess
import sys

if (len(sys.argv) > 1):
    if (sys.argv[1] == '0'):
        subprocess.call(["xrandr", "-o", "normal"])
        subprocess.call(["xsetwacom", "--set", 
                           "Serial Wacom Tablet WACf004 stylus", "Rotate", 
                           "none"])
    elif (sys.argv[1] == '1'):
        subprocess.call(["xrandr", "-o", "right"])
        subprocess.call(["xsetwacom", "--set", 
                           "Serial Wacom Tablet WACf004 stylus", "Rotate", 
                           "cw"])
    else:
        print('Not a valid option')
else:
    print("No argument given")
